package com.blb.ioc.demo.service.impl;

import com.blb.ioc.demo.dao.IStudentDAO;
import com.blb.ioc.demo.dao.impl.StudentDAOImpl;
import com.blb.ioc.demo.entity.Student;
import com.blb.ioc.demo.service.IStudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class StudentServiceImpl implements IStudentService {

    @Autowired
    private IStudentDAO studentDAO;

    @Override
    public void addStudent(Student student) {
        studentDAO.add(student);
    }

    @Override
    public Student findById(Long id) {
        return studentDAO.selectById(id);
    }
}
